<template>
    <div>
        <el-input
        v-model="names"
        clearable
        type="text"
        :placeholder="placeholder"
        style="width: 250px"
        >
            <i
            slot="prefix"
            class="el-input__icon el-icon-search"
            @click="handleSearched"
            >
            </i>
      </el-input>
    </div>
</template>

<script>
export default{
    name:"SearchInput",
    props:{
        placeholder:{
            type:String,
            default:'',
        },
        page:{
            type:Number,
            default:1,
        },

    },
    data(){
        return{
            names:'',
        }
    },
    methods:{
        handleSearched(){
            this.$emit('handleSearch',this.names)
            this.page=1
        }
    },

}
</script>